﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demos.DesignPatterns._16_责任链模式
{
    /// <summary>
    /// 审批人抽象类
    /// </summary>
    public abstract class Approver
    {
        /// <summary>
        /// 下一个审批人
        /// </summary>
        protected Approver NextApprover { get; private set; }
        /// <summary>
        /// 定义下一个审批对象
        /// </summary>
        /// <param name="next"></param>
        public void SetNext(Approver next)
        {
            NextApprover = next;
        }
        /// <summary>
        /// 处理审批
        /// </summary>
        /// <param name="request"></param>
        public abstract void ProcessRequest(PurchaseRequest request);

    }
}
